import React from 'react';
import { Card, Descriptions } from 'antd';
import { getDicByKey } from '@/support/common';
import PropTypes from 'prop-types';

export default class EngineTab extends React.Component<any, any> {
  static contextTypes = {
    dicData: PropTypes.any,
  };
  render() {
    const { engineVo2, engineState } = this.props;
    let engineVo = engineVo2 || {};
    return (
      <>
        <Descriptions bordered size="small">
          <Descriptions.Item label="发动机状态">
            {engineState ? getDicByKey(this.context.dicData, 'engineState', `${engineState}`) : ''}
            {/* {engineState} */}
          </Descriptions.Item>
          <Descriptions.Item label="曲轴转速(r/min)">
            {engineVo.crankshafSpeed ? `${engineVo.crankshafSpeed}` : ''}
          </Descriptions.Item>
          <Descriptions.Item label="燃料消耗率(L/100km)">
            {engineVo.fuelConsumptionRate ? `${engineVo.fuelConsumptionRate}` : ''}
          </Descriptions.Item>
        </Descriptions>
      </>
    );
  }
}
